package cn.myjerry.prototype;

import java.util.Date;

public class Sheep2 implements Cloneable {
	private String Name;
	private Date birthday;
	public Sheep2() {
		super();
	}
	public Sheep2(String name, Date birthday) {
		super();
		Name = name;
		this.birthday = birthday;
	}
	@Override
	protected Object clone() throws CloneNotSupportedException {
		Object obj = super.clone();
		
		/**
		 * 添加如下代码实现深复制(deep clone)
		 */
		Sheep2 s = (Sheep2) obj;
		s.birthday = (Date) this.birthday.clone();
		
		return obj;
	}
	public String getName() {
		return Name;
	}
	public void setName(String name) {
		Name = name;
	}
	public Date getBirthday() {
		return birthday;
	}
	public void setBirthday(Date birthday) {
		this.birthday = birthday;
	}
}
